package com.diaohw.module.metadata.obj.convert;

import com.diaohw.module.metadata.obj.dto.MetaItemDTO;
import com.diaohw.module.metadata.obj.entity.MetaItemDO;
import com.diaohw.module.metadata.obj.vo.MetaItemVO;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * <p>
 * 元数据属性 类型转换
 * </p>
 *
 * @author D-Hw
 * @since 2025-04-11
 */
@Mapper
public interface MetaItemConvert {

    MetaItemConvert INSTANCE = Mappers.getMapper(MetaItemConvert.class);

    /**
     * dto to entity
     */
    @InheritConfiguration
    MetaItemDO dtoToEntity(MetaItemDTO dto);

    /**
     * entity to dto
     */
    @InheritConfiguration
    MetaItemDTO entityToDto(MetaItemDO entity);

    /**
     * entity to dto
     */
    @InheritConfiguration
    MetaItemVO entityToVo(MetaItemDO entity);

    /**
     * entity to dto
     */
    @InheritConfiguration
    List<MetaItemVO> entityToVo(List<MetaItemDO> list);


    @InheritConfiguration
    MetaItemVO toVo(MetaItemDTO data);
}

